<?php if($results === false):?>
	<div class="alert alert-error">
		По вашему запросу ничего не найдено
	</div>
<?php else:?>
	<div class="alert alert-info">
		<?php if(isset($results['params']['type'])):?>
			<b>Автомобиль:</b> <?php echo $results['params']['type']['MFA_BRAND'], ' ', $results['params']['type']['MOD_TEXT'], ' ', $results['params']['type']['TYP_TEXT'];?><br>
		<?php endif;?>
		<?php if(isset($results['params']['search_code']) && isset($results['params']['original_code'])):?>
			<b>Поисковой номер:</b> <?php echo $results['params']['original_code'];?> (<?php echo $results['params']['search_code'];?>)<br>
		<?php endif;?>
		<b>Всего найдено запчастей:</b> <?php echo $results['count'];?><br>
		<b>Показано на странице:</b> <?php echo count($results['articles']);?>
	</div>
	<?php $this->widget('MyLinkPager', array(
		'pages' => $pages,
	))?>
	<div>
		<?php echo CHtml::link("К форме поиска", $this->createUrl('/catalog/admin/typeSearch'), array('class'=>'btn'));?>
	</div>
	<table class="table table-bordered table-striped">
		<tr>
			<th>#</th>
			<th>Наименование</th>
			<th>Фирма</th>
			<th>Актикул</th>
			<th>Цена</th>
		</tr>
		
		<?php foreach($results['articles'] as $i=>$article):?>
		<tr>
			<td><?php echo $i + $pageSize*$page + 1;?></td>
			<td>
				<a href="<?php echo $this->createUrl('/catalog/admin/article/info', array('id'=>$article['ART_ID']))?>">
					<?php echo isset($article['TEX_TEXT_RU']) ? $article['TEX_TEXT_RU'] : $article['TEX_TEXT_EN'];?>
				</a>
			</td>
			<td><?php echo $article['SUP_BRAND']?></td>
			<td><?php echo $article['ART_ARTICLE_NR']?></td>
			<td>
				<table>
				<?php if(isset($results['prices'][$article['ART_ID']])):?>
					<?php foreach($results['prices'][$article['ART_ID']] as $price):?>
						<tr>
							<td><?php echo $price['PTP_NAME'];?>:</td>
							<td><?php echo number_format($price['VALUE'], 2, ',', ' ');?></td>
							<td>RUR</td>
						</tr>
					<?php endforeach;?>
				<?php endif;?>
				</table>
			</td>
		</tr>
		<?php endforeach;?>
	</table>
	<?php $this->widget('MyLinkPager', array(
		'pages' => $pages,
	))?>
<?php endif;?>